#include "pch.h"
#include "seLifes.h"

void seLifes::Init(int number, int x, int y)
{
	actualLives=number;
	mImage.LoadFromFile("data/heart.png");
	mSprite.SetImage(mImage);
	initPositionX = x;
	mSprite.SetPosition(x,y);
}

void seLifes::Step(int newActualLives)
{
	actualLives = newActualLives;
	if(actualLives == 0)
		mGameState = seGame::ShowingScores;
}

void seLifes::Draw()
{
	for (int a=0;a<actualLives;a++){
		mSprite.SetPosition(initPositionX+a*(mSprite.GetSize().x),mSprite.GetPosition().y);
		app.Draw(mSprite);
	}
}